# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=rancher-cli
pkgver=2.8.0
pkgrel=0
pkgdesc="The Rancher CLI"
url="https://www.rancher.com/"
arch="all"
license="Apache-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/rancher/cli/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/cli-$pkgver"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v -o bin/rancher -ldflags "-X main.VERSION=v$pkgver"
}

check() {
	go test ./...
}

package() {
	install -Dm755 bin/rancher -t "$pkgdir"/usr/bin
}

sha512sums="
9a2c3c4c7a2a8210a30414e2efdf25fcc0e55ffea2ecdd07d7427deab8d3aaf2eb2b3560b7cb8bc14ad678ac73dd98230ca40024d58e757de5f2e40becd4d28c  rancher-cli-2.8.0.tar.gz
"
